﻿using Com.OpenCode.Framework.Core;
using Com.OpenCode.Framework.DevForm;

namespace Com.OpenCode.Framework.Workbench
{
    public class RightMenuDoozer : IDoozer
    {
        public object BuildItem(BuildItemEventArgs args)
        {
            object obj = null;
            string _TypeName = args.Plugin.Properties.Get("Type").ToString();
            switch (_TypeName)
            {
                case "Menu":
                    obj = new RightMenuUI(args);
                    foreach (Plugin child in args.Plugin.Children)
                    {
                        child.Addin.Bulid(child, obj);
                    }
                    break;
                case "Button":
                    obj = new RightMenuButtonUI(args);
                    break;
                case "SubItem":
                    obj = new RightMenuSubItemUI(args);
                    foreach (Plugin child in args.Plugin.Children)
                    {
                        child.Addin.Bulid(child, obj);
                    }
                    break;
            }
            return obj;
        }

        public string Name
        {
            get { return "RightMenu"; }
        }
    }
}